
#指定运行环境
FROM mcr.microsoft.com/dotnet/aspnet:6.0 as base
WORKDIR /app
EXPOSE 9049
#ENV ASPNETCORE_URLS=HTTP://*:9050
ENV ASPNETCORE_ENVIRONMENT Development
#指定编译和运行环境
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
# Copy everything 
COPY . .
# Restore as distinct layers

RUN dotnet build -c release -o /app/build
FROM base as final
WORKDIR /app
#将build阶段内构建的输出（/app/build）复制到最终镜像内,由于无需包含 sdk 映像中的所有生成工具，因此此过程可以使最终映像小得多
COPY --from=build /app/build .
ENTRYPOINT ["dotnet", "LogForParameter.Api.dll"]
